<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      body {
        margin: 0;
        padding: 0;
        overflow: hidden;
      }
      .dargwer {
        width: 400px;
        height: 100vh;
        background-color: pink;
        position: fixed;
        top: 0;
        right: -400px;
        transition: all 1s;
        opacity: 0;
      }
    </style>
  </head>
  <body>
    <div class="dargwer">123</div>
    <script>
      const dargwer = document.querySelector(".dargwer");
      let isShow = false;
      const show = () => {
        dargwer.style.right = "0";
        dargwer.style.opacity = "1";
        isShow = true;
      };
      const hide = () => {
        dargwer.style.right = "-400px";
        dargwer.style.opacity = "0";
        isShow = false;
      };
      setTimeout(() => {
        show();
        setTimeout(() => {
          hide();
        }, 3000);
      }, 1000);
    </script>
  </body>
</html>
